#!/usr/bin/env php
<?php
/**
* BigDb CLI. UNDER DEVELOPMENT
*
* @TODO add support for multiple BigDb apps. Primary intended use is for USERS of BigDb Apps. This would mean loading all BigDb apps inside vendor/, assuming composer usage.
* @TODO add object calling (i.e. run a query, load result into orm, then call a method on the orm object)
*/
$own_autoloader = dirname(__DIR__).'/vendor/autoload.php';
$their_autoloader = dirname(__DIR__, 3).'/autoload.php';
if (file_exists($their_autoloader)){
require($their_autoloader);
} else if (file_exists($own_autoloader)){
require($own_autoloader);
} else {
echo "\nCan't load composer autoload.php\n\n";
return;
}
$cli = new \Tlf\BigDb\BigDbCli();
$cli->exclude_from_help[] = 'main';
$cli->exclude_from_help[] = 'help';
// load_json_file fails silently if the file does not exist
// $cli->load_json_file(__DIR__.'/defaults.json');
// $cli->load_inputs(json_decode(file_get_contents(__DIR__.'/user_configs.json'),true));
$cli->load_stdin();
$cli->init();
$cli->execute();